package com.shph.validation.rule.impl;

import com.shph.validation.exception.ValidFailException;
import com.shph.validation.rule.IRule;

/**
 * 校验任意对象，该对象不能为空
 */
public class NotNullRule implements IRule<Object> {
    @Override
    public boolean test(Object value, String refValue) {
        if (value == null) {
            throw new ValidFailException("该值不能为空！");
        }
        return true;
    }
}
